package org.qqcui.designpattern.patterns.adapter.object;

/**
 * 手机类
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/4/28 16:47
 **/
public class Phone {

    public void charge(IVoltage5V voltage5V) {
        if (voltage5V.output5v() == 5) {
            System.out.println("电压5V，可以充电");
        } else if (voltage5V.output5v() > 5) {
            System.out.println("电压大于5V，无法充电");
        }
    }
}
